
<script>
    let _ret=<%-JSON.stringify(ret)%>;
    console.log(_ret);
    let mlist={};
    for(let i in _ret.members){
        mlist[_ret.members[i].name]=_ret.members[i].name;
    }
    let blist={}
    for(let i in _ret.branchs){
        blist[_ret.branchs[i]._id]=_ret.branchs[i].name;
    }
    //console.log(mlist);

    let status_list = {0:'N',1:'Y'};
    let status_format=function(cellvalue,options,rowObjec){
        if(cellvalue){
            return '<font color="green">Y</font>';
        }
        else{
            return '<font color="red">N</font>';
        }

    }
    let status_unformat=function(cellvalue,options,cell){
        if(cellvalue==='Y'){
            return 1;
        }else{
            return 0;
        }
    }


    let option = {
        colModel : [
            {label: '_id', name: '_id',width: 100,key:true,editable:true, hidden:true,fixed:true,search:true},
            {label: 'uid', name: 'uid',width: 100,editable:true, hidden:true,fixed:true,search:true},
            {label: '姓名', name: 'name',width: 100, editable: true,edittype:'select', editoptions:{value:mlist},stype:"select",sortable:false,hidden:false,resize:false,fixed:true,search:false},
            {label: '游戏', name: 'branch',width: 100, editable: true, edittype:'select', editoptions:{value:blist},stype:"select",formatter:'select',sortable:false,hidden:false,resize:false,fixed:true,search:false},
            {label: '内部员工', name: 'inner',width: 80, editable: true, sortable:false,hidden:false,resize:false,fixed:true,search:false,formatter:'checkbox',edittype:'checkbox', editoptions:{value:"1:0"}}, 
            {label: '调试入口', name: 'dev',width: 80, editable: true, sortable:false,hidden:false,resize:false,fixed:true,search:false,formatter:'checkbox', edittype:'checkbox', editoptions:{value:"1:0"},stype:"select"},
            {label: '运营入口', name: 'op',width: 80, editable: true, sortable:false,hidden:false,resize:false,fixed:true,search:false,formatter:'checkbox', edittype:'checkbox', editoptions:{value:"1:0"},stype:"select"},
            {label: '-数据查看', name: 'view',width: 80, editable: true, sortable:false,hidden:false,resize:false,fixed:true,search:false,formatter:'checkbox', edittype:'checkbox', editoptions:{value:"1:0"},stype:"select"},
            {label: '-活动管理', name: 'event_edit',width: 80, editable: true, sortable:false,hidden:false,resize:false,fixed:true,search:false,formatter:'checkbox', edittype:'checkbox', editoptions:{value:"1:0"},stype:"select"},
            {label: '-玩家管理', name: 'player_edit',width: 80, editable: true, sortable:false,hidden:false,resize:false,fixed:true,search:false,formatter:'checkbox', edittype:'checkbox', editoptions:{value:"1:0"},stype:"select"},
            {label: '-运营操作', name: 'op_edit',width: 80, editable: true, sortable:false,hidden:false,resize:false,fixed:true,search:false,formatter:'checkbox',edittype:'checkbox', editoptions:{value:"1:0"},stype:"select"}, 
            {label: '-渠道操作', name: 'dev_edit',width: 80, editable: true, sortable:false,hidden:false,resize:false,fixed:true,search:false,formatter:'checkbox',edittype:'checkbox', editoptions:{value:"1:0"}},  


        ]
    }
    $(document).ready(function () {
        cosjs_create_jqgrid(option);
        $(grid_selector).jqGrid('navGrid',{
            search:false
        })
    });
</script>
